<?php
include_once('common/header.php');
if($AppUI->id <= 0 || (isset($_SESSION['event']) && (($_SESSION['event']&1<<2) == 0))) {
	$this->_redirect(HOST_BACKEND);
}
$intEventId 		= $objRequest->getParam('eventid', 0);
$objEvent			= new Event();
$objCommon			= new Ecore_Common();
$objCategory		= new Category();
$objSlideshow		= new Slideshow();
$arrRow				= $objEvent->get($intEventId);
if(isset($_SESSION['EVENT_POST']['pprovince'])) $intProvinceId = $_SESSION['EVENT_POST']['pprovince'];
else $intProvinceId = $arrRow['province'];
$this->view->row			= $arrRow;
$this->view->arrProvince	= $objCommon->getProvince();
$this->view->arrDistrict	= $objCommon->getDistrict($intProvinceId);
$this->view->arrCategory	= $objCategory->getParent(EVENT_TYPE);
$this->view->arrAlbum		= $objSlideshow->getAlbumForCombo(EVENT_TYPE);
$this->view->arrAdv			= $arrAdv;
$this->view->back			= isset($_SESSION[SESSION_BACKURL]) ? $_SESSION[SESSION_BACKURL] : HOST_BACKEND;
if(isset($_SESSION['EVENT_POST']['ptbfeature'])) {
	$strJson	= str_replace('\\','',$_SESSION['EVENT_POST']['ptbfeature']);	
	$this->view->arrFeatures = json_decode($strJson);
}elseif(isset($arrRow['features'])) {
	$strJson	= str_replace('\\','',$arrRow['features']);	
	$this->view->arrFeatures = json_decode($strJson);
}
